import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import { Tag } from 'ant-design-vue';
import { dictAllListApi, supplierListApi, materialListApi } from '@/api/sys/msUser';
import util from '@/utils/util';

import { useMessage } from '@/hooks/web/useMessage';
import { VxeFormItemProps, VxeGridPropTypes } from '@/components/VxeTable';

type CheckedType = boolean | string | number;
// BasicColumn[]
export const columns: FormSchema[] = [
  {
    title: '物料编号',
    dataIndex: 'mtid',
  },
  {
    title: '物料名称',
    dataIndex: 'mname',
  },
  {
    title: '规格',
    dataIndex: 'guige',
  },
  {
    title: '型号',
    dataIndex: 'mmodel',
  },
];

export const vxeTableColumns: VxeGridPropTypes.Columns = [
  { type: 'checkbox', width: 60, align: 'center' },
  {
    title: '物料编号',
    field: 'mtid',
    filters: [{ data: '' }],
    filterRender: {
      name: 'VxeInput',
    },
    showOverflow: 'title',
  },
  {
    title: '物料名称',
    field: 'mname',
    filters: [{ data: '' }],
    filterRender: {
      name: 'VxeInput',
    },
    showOverflow: 'title',
  },
  {
    title: '规格',
    field: 'guige',
    filters: [{ data: '' }],
    filterRender: {
      name: 'VxeInput',
    },
    showOverflow: 'title',
  },
  {
    title: '型号',
    field: 'mmodel',
    filters: [{ data: '' }],
    filterRender: {
      name: 'VxeInput',
    },
    showOverflow: 'title',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'keyword',
    label: '名称/编号',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    span: 8,
    field: 'keyword',
    title: '名称/编号',
    itemRender: {
      name: 'AInput',
    },
  },
];
